import 'package:flutter/widgets.dart';
import 'package:mobile_app.core/core/presentation/utils/screen_util.dart';

class ScreenUtilInitializer extends StatelessWidget {
  const ScreenUtilInitializer({
    required this.builder,
    super.key,
  });

  final Widget Function() builder;

  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (context, constraints) {
        final screenSize = Size(constraints.maxWidth, constraints.maxHeight);

        ScreenUtil.init(
          screenSize: screenSize,
          context: context,
        );

        return builder();
      },
    );
  }
}
